<div class="layuimini-main">

    <div class="layui-form layuimini-form">
    	<input type="hidden"  id="taskId" />
        <div class="layui-form-item">
            <label class="layui-form-label">申请人</label>
            <div class="layui-input-block">
                <input type="text"  id="userId" readonly="readonly" class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">申请时间</label>
            <div class="layui-input-block">
               <input type="text"  id="taskcreatetime" readonly="readonly" class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">开始时间</label>
            <div class="layui-input-block">
               <input type="text"  id="start_time"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">结束时间</label>
            <div class="layui-input-block">
               <input type="text"  id="end_time"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">请假类型</label>
            <div class="layui-input-block">
               <input type="text"  id="leave_type"  class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">请假原因</label>
            <div class="layui-input-block">
                <textarea id="reason" class="layui-textarea" ></textarea>
            </div>
        </div>
        
        <div class="layui-form-item">
             <label class="layui-form-label">是否继续申请</label>
             <div class="layui-input-block">
                 <select id="reapply" lay-filter="aihao">
                    	<option value="true">重新申请</option>
						<option value="false">放弃申请</option>
                 </select>
             </div>
         </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="saveBtn">完成</button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            $.ajax({
				url:'updateApply',
				dataType:'json',
				type:'GET',
				data:{
					"taskid":$("#taskId").val(),
					"leave_type":$("#leave_type").val(),
					"start_time":$("#start_time").val(),
					"end_time":$("#end_time").val(),
					"reason":$("#reason").val(),
					"reapply":$("#reapply").val()
				},
				success:function(data){
					 // 关闭弹出层
            		layer.close(parentIndex);
				}
			});
	    	return false;
        });

    });
</script>